Optimal. Leaf size=137 \[ -\frac {2 a (A (2 n+3)+2 B (n+1)) \cos (e+f x) \sin ^{-n}(e+f x) (d \sin (e+f x))^n \, _2F_1\left (\frac {1}{2},-n;\frac {3}{2};1-\sin (e+f x)\right )}{f (2 n+3) \sqrt {a \sin (e+f x)+a}}-\frac {2 a B \cos (e+f x) (d \sin (e+f x))^{n+1}}{d f (2 n+3) \sqrt {a \sin (e+f x)+a}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.21, antiderivative size = 137, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 35, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.114, Rules used = {2981, 2776, 67, 65} \[ -\frac {2 a (A (2 n+3)+2 B (n+1)) \cos (e+f x) \sin ^{-n}(e+f x) (d \sin (e+f x))^n \, _2F_1\left (\frac {1}{2},-n;\frac {3}{2};1-\sin (e+f x)\right )}{f (2 n+3) \sqrt {a \sin (e+f x)+a}}-\frac {2 a B \cos (e+f x) (d \sin (e+f x))^{n+1}}{d f (2 n+3) \sqrt {a \sin (e+f x)+a}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 65
Rule 67
Rule 2776
Rule 2981
Rubi steps
\begin {align*} \int (d \sin (e+f x))^n \sqrt {a+a \sin (e+f x)} (A+B \sin (e+f x)) \, dx &=-\frac {2 a B \cos (e+f x) (d \sin (e+f x))^{1+n}}{d f (3+2 n) \sqrt {a+a \sin (e+f x)}}+\left (A+\frac {2 B (1+n)}{3+2 n}\right ) \int (d \sin (e+f x))^n \sqrt {a+a \sin (e+f x)} \, dx\\ &=-\frac {2 a B \cos (e+f x) (d \sin (e+f x))^{1+n}}{d f (3+2 n) \sqrt {a+a \sin (e+f x)}}+\frac {\left (a^2 \left (A+\frac {2 B (1+n)}{3+2 n}\right ) \cos (e+f x)\right ) \operatorname {Subst}\left (\int \frac {(d x)^n}{\sqrt {a-a x}} \, dx,x,\sin (e+f x)\right )}{f \sqrt {a-a \sin (e+f x)} \sqrt {a+a \sin (e+f x)}}\\ &=-\frac {2 a B \cos (e+f x) (d \sin (e+f x))^{1+n}}{d f (3+2 n) \sqrt {a+a \sin (e+f x)}}+\frac {\left (a^2 \left (A+\frac {2 B (1+n)}{3+2 n}\right ) \cos (e+f x) \sin ^{-n}(e+f x) (d \sin (e+f x))^n\right ) \operatorname {Subst}\left (\int \frac {x^n}{\sqrt {a-a x}} \, dx,x,\sin (e+f x)\right )}{f \sqrt {a-a \sin (e+f x)} \sqrt {a+a \sin (e+f x)}}\\ &=-\frac {2 a \left (A+\frac {2 B (1+n)}{3+2 n}\right ) \cos (e+f x) \, _2F_1\left (\frac {1}{2},-n;\frac {3}{2};1-\sin (e+f x)\right ) \sin ^{-n}(e+f x) (d \sin (e+f x))^n}{f \sqrt {a+a \sin (e+f x)}}-\frac {2 a B \cos (e+f x) (d \sin (e+f x))^{1+n}}{d f (3+2 n) \sqrt {a+a \sin (e+f x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 67.65, size = 409, normalized size = 2.99 \[ -\frac {(1+i) 2^{-n-2} e^{i f n x-\frac {3 i e}{2}} \left (1-e^{2 i (e+f x)}\right )^{-n} \left (-i e^{-i (e+f x)} \left (-1+e^{2 i (e+f x)}\right )\right )^n \sqrt {a (\sin (e+f x)+1)} \sin ^{-n}(e+f x) (d \sin (e+f x))^n \left (2 e^{i e} \left (\frac {e^{\frac {1}{2} i (2 e+f (1-2 n) x)} \left (i B (2 n-1) e^{i (e+f x)} \, _2F_1\left (\frac {1}{4} (3-2 n),-n;\frac {1}{4} (7-2 n);e^{2 i (e+f x)}\right )-(2 n-3) (2 A+B) \, _2F_1\left (\frac {1}{4} (1-2 n),-n;\frac {1}{4} (5-2 n);e^{2 i (e+f x)}\right )\right )}{f (2 n-3) (2 n-1)}-\frac {i (2 A+B) e^{-\frac {1}{2} i f (2 n+1) x} \, _2F_1\left (\frac {1}{4} (-2 n-1),-n;\frac {1}{4} (3-2 n);e^{2 i (e+f x)}\right )}{2 f n+f}\right )+\frac {2 B e^{-\frac {1}{2} i f (2 n+3) x} \, _2F_1\left (\frac {1}{4} (-2 n-3),-n;\frac {1}{4} (1-2 n);e^{2 i (e+f x)}\right )}{f (2 n+3)}\right )}{\sin \left (\frac {1}{2} (e+f x)\right )+\cos \left (\frac {1}{2} (e+f x)\right )} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [F] time = 0.47, size = 0, normalized size = 0.00 \[ {\rm integral}\left ({\left (B \sin \left (f x + e\right ) + A\right )} \sqrt {a \sin \left (f x + e\right ) + a} \left (d \sin \left (f x + e\right )\right )^{n}, x\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (B \sin \left (f x + e\right ) + A\right )} \sqrt {a \sin \left (f x + e\right ) + a} \left (d \sin \left (f x + e\right )\right )^{n}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [F] time = 1.06, size = 0, normalized size = 0.00 \[ \int \left (d \sin \left (f x +e \right )\right )^{n} \sqrt {a +a \sin \left (f x +e \right )}\, \left (A +B \sin \left (f x +e \right )\right )\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (B \sin \left (f x + e\right ) + A\right )} \sqrt {a \sin \left (f x + e\right ) + a} \left (d \sin \left (f x + e\right )\right )^{n}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.01 \[ \int {\left (d\,\sin \left (e+f\,x\right )\right )}^n\,\left (A+B\,\sin \left (e+f\,x\right )\right )\,\sqrt {a+a\,\sin \left (e+f\,x\right )} \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \sqrt {a \left (\sin {\left (e + f x \right )} + 1\right )} \left (d \sin {\left (e + f x \right )}\right )^{n} \left (A + B \sin {\left (e + f x \right )}\right )\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________